#ifndef CPP_ALLOC_HPP
#define CPP_ALLOC_HPP

#ifdef CPP_NOALLOC_HPP
    #error "ERROR: Alloc and no alloc headers included!"
#endif

#include <stdlib.h>


extern "C" void __cxa_pure_virtual()
{
    // Do nothing or print an error message.
}


void *operator new(size_t size)
{
    return malloc(size);
}

void *operator new[](size_t size)
{
    return malloc(size);
}

void operator delete(void *p)
{
    free(p);
}

void operator delete[](void *p)
{
    free(p);
}

#endif
